Don't throw InexactError for comparisons between FDs of different types and/or Integers#88
Don't throw InexactError for comparisons between FDs of different types and/or Integers#88
Conversation
|
Note that this PR doesn't address InexactError caused by promotion during arithmetic, e.g.: julia> FixedDecimal{Int8,2}(1) + 2 # Same here: 2 is promoted to FD{Int8,2}(2)
ERROR: InexactError: convert(FixedDecimal{Int8, 2}, 2)I think that's okay for now. If we fixed it, this would either throw an OverflowError anyway if you used checked arithmetic, or it would wrap, using the new semantics. We should probably add support for this, but at least at RAI we're using checked arithmetic for everything so this is going to throw either way and so it seems less urgent to fix it to me. |
|
Thanks for the quick review! Ready for another round 😊 |
mcmcgrath13
left a comment
There was a problem hiding this comment.
❤️ thank you!! Can you just make sure we have full test coverage before merging?
8369395 to
7621196
Compare
|
Thanks Mary. 100% diff coverage now. (That's a really helpful tool.) Here I go! :) I'm gonna also mark this as a patch version bump, since it's a strict improvement. |
Fixes #82.
Before:
After, these all return true. :)
The idea in this PR is to check whether the values would fit in eachother's types, and if not, that's your answer, rather than throwing an InexactError if they fail to promote.